package com.spdd.mt.biz.constant;

import com.spdd.mt.common.base.BaseEnum;

/**
 * 运营商枚举
 *
 * @since 2025-04-15
 */
public enum Operator implements BaseEnum<String> {

    YD("CM", "移动"),
    LT("CU", "联通"),
    DX("CT", "电信"),
    GD("BN", "⼴电"),
    ;

    private final String value;

    private final String desc;

    Operator(String value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    @Override
    public String getValue() {
        return value;
    }

    @Override
    public String getDesc() {
        return desc;
    }

    public static String getNameByValue(String value) {
        for (Operator enums : Operator.values()) {
            if (enums.getValue().equals(value)) {
                return enums.desc;
            }
        }
        return null;
    }

    public static String getCodeByName(String desc) {
        for (Operator enums : Operator.values()) {
            if (enums.desc.equals(desc)) {
                return enums.value;
            }
        }
        return null;
    }

}
